package priv.abadstring.study.mbp.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.time.LocalDateTime;

/**
 * User
 *
 * @author aBadString
 * @date 2021-06-15 11:30:50
 */
@Getter @Setter @ToString
public class User {
    // 自增 ID
    // @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private String name;
    private Integer age;
    private String email;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    // 版本号机制的乐观锁
    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version;

    // 逻辑删除标志
    @TableLogic
    private Integer deleted;
}
